#include <bits/stdc++.h> 
using namespace std;

int main(){
   char a[17][2];
   string b[17];
   int c[17];
   int i,j,count=0,less=0,m,n;
    for(i=1;i<=16;i++){
    		cin>>a[i];	
			b[i]=a[i];	
	}
	for(i=1;i<=16;i++){
		if(b[i].size()==1){
			if(b[i][0]=='#'){
				c[i]=16;
				m=i/4+1;
				n=i%4;
			}
			
			else
			c[i]=b[i][0]-'0';
		}else
		    c[i]=(b[i][0]-'0')*10+(b[i][1]-'0');
				
	}	
	for(i=1;i<17;i++){
	   for(j=i+1;j<17;j++){
	   	if(c[j]<c[i])
	   	count++;
	   }
	   less=less+count;
	   count=0;
	   	
	}
	less=less+m+n;
	if(less%2==0) cout<<"TRUE";
	else cout<<"FALSE";
   return 0;
}


